/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import controller.TimeTablesOfUser;
import entities.TimeTable;
import java.util.List;
import javax.faces.application.Application;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author QUY-THI
 */
@ManagedBean
@SessionScoped
public class TimeTableOfUserBean {

    private List<TimeTable> times;

    public List<TimeTable> getTimes() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        Application app = facesContext.getApplication();
        LoginBean lg = (LoginBean) app.createValueBinding("#{loginBean}").getValue(facesContext);
        TimeTablesOfUser tou = new TimeTablesOfUser();
        return tou.timeTablesOfUser(lg.getUser().getUserID());
    }

    public void setTimes(List<TimeTable> times) {
        this.times = times;
    }

    /**
     * Creates a new instance of TimeTableOfUserBean
     */
    public TimeTableOfUserBean() {
    }
}
